package com.example.logistics.listener;

import com.example.orderservice.model.OrderInfo;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: hp
 * Date: 2025-04-02
 * Time: 20:01
 */
@Component
@RabbitListener(queues = "order.create")
public class OrderListener {
    @RabbitHandler
    public void handMessage1(String orderInfo) {
        System.out.println("接收到订单消息String: " + orderInfo);
    }

    @RabbitHandler
    public void handMessage2(OrderInfo orderInfo) {
        System.out.println("接收到订单消息OrderInfo: " + orderInfo);
    }

}
